<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    /*选择价表自动补全*/
    autoCompleteCom("component");
    function autoCompleteCom(inputId){
        var url="${ctx}/blood/bloodComponent/autoComplete";
        autoComplete(inputId,url,
            function(data){
                var rows = [];
                for(var i=0; i<data.length; i++){
                    rows[rows.length] = {
                        data:data[i],
                        value:data[i].id,
                        result:data[i].bloodName
                    };
                }
                return rows;
            },function(data, i, max){
                return data.inputCode + ' | '+data.bloodName
            },function(event,data,formatted){
                $('#componentId').attr('value',data.id);
            });
    }
</script>
<div class="panel-body">
    <div class="col-lg-12">
        <form:form id="inputCapacityForm" data-parsley-validate="" modelAttribute="bloodCapacity" onsubmit="return formSaveLoadDiv('capacityListDiv','inputCapacityForm','${ctx}/blood/bloodCapacity/save','${ctx}/blood/bloodCapacity/list?applyId=${bloodCapacity.applyId}',closeCapacityFormDiv);" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <form:hidden path="applyId"  />
                <div class="form-group">
                    <label class="col-sm-4 control-label">用血安排：</label>
                    <div class="col-sm-8">
                        <form:select path="fastSlow" id="fastSlow"  class="form-control" data-parsley-required="true">
                            <form:options items="${fns:getDictList('FAST_SLOW')}" itemLabel="label" itemValue="value" htmlEscape="false" data-parsley-required="true"/>
                        </form:select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">预定输血时间：</label>
                    <div class="col-sm-8">
                        <input name="transDate" readonly class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<fmt:formatDate value="${bloodCapacity.transDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">血量：</label>
                    <div class="col-sm-8">
                        <form:input path="transCapacity" htmlEscape="false" class="form-control"  data-parsley-type="number" data-parsley-required="true" value="200"/>
                    </div>
                </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">单位：</label>
                <div class="col-sm-8">
                    <form:select path="unit" id="unit"  class="form-control" data-parsley-required="true">
                        <form:options items="${fns:getDictList('BLOOD_UNIT_DICT')}" itemLabel="label" itemValue="value" htmlEscape="false" data-parsley-required="true"/>
                    </form:select>
                </div>
            </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">血液要求：</label>
                    <div class="col-sm-8">
                        <form:hidden path="componentId" id="componentId" />
                        <input id="component" class="form-control"  required/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="closeCapacityFormDiv()">
                </div>
            </div>
        </form:form>
    </div>

</div>
